<template>
  <div class="login">
    <el-form
      ref="form"
      :model="form"
      label-position="top"
      label-width="80px">
      <span class="title">登录</span>
      <el-form-item label="手机号">
        <el-input v-model="form.phone"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="form.password"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'

export default Vue.extend({
  name: 'LoginIndex',
  data () {
    return {
      form: {
        phone: '',
        password: ''
      }
    }
  },
  methods: {
    onSubmit () {
      console.log('submit!')
    }
  }
})
</script>

<style lang="scss" scoped>
.login {
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;

  .el-form {
    padding: 30px;
    border-radius: 10px;
    background-color: #fff;

    .el-form-item {
      width: 300px;
    }

    .title {
      font-size: 21px;
      line-height: 50px;
    }
    .el-button {
      margin-top: 20px;
      width: 100%;
    }
  }
}
</style>
